<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<IEnumerable<LinQDemo.Models.Student>>" %>
<%@ Import Namespace="LinQDemo.Models" %>
<%@ Import Namespace="System.Web" %>
<script runat="server">
    protected void Label1_Load(object sender, EventArgs e)
    {

        foreach (var item in Model)
        {
            Label1.Text = Html.Encode(item.StudentID);
        }
    }

</script>

<table>
        <tr>
            <th></th>
            <th>
                StudentID
            </th>
            <th>
                StudentName
            </th>
            <th>
                ClassID
            </th>
            <th>
                IsValid
            </th>
        </tr>

    <% foreach (var item in Model) { %>
    
        <tr>
            <td>
                <%= Html.ActionLink("Edit", "Edit", new { id=item.StudentID }) %> |
                <%= Html.ActionLink("Details", "Details", new { id=item.StudentID })%>
            </td>
            <td>
                <%= Html.Encode(item.StudentID) %>
            </td>
            <td>
                <%= Html.Encode(item.StudentName) %>
            </td>
            <td>
                <%= Html.Encode(item.ClassID) %>
            </td>
            <td>
                <%= Html.Encode(item.IsValid) %>
            </td>
        </tr>
    
    <% } %>

    </table>
        <% using (Html.BeginForm()) {%>
        
        <asp:Button ID="Button1" Text="Button" type="submit" />
        
    <% } %>
    
    
<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
    <p>
        <%= Html.ActionLink("Create New", "Create") %>
    </p>






































